package com.aloda.controller;

import com.aloda.pojo.dto.LogPageDTO;
import com.aloda.pojo.entity.Log;
import com.aloda.result.PageResult;
import com.aloda.result.Result;
import com.aloda.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/log")
public class LogController {

    @Autowired
    private LogService logService;

    /**
     * 分页查询日志
     * @param logPageDTO
     * @return
     */
    @PostMapping("/page")
    public Result<PageResult<Log>> getLogPage(@RequestBody LogPageDTO logPageDTO) {
        PageResult<Log> result = logService.getLogPage(logPageDTO);
        return Result.success(result);
    }
}
